/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.res0w.SMMS.ds;

import com.res0w.SMMS.factory.DataBaseOperate;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author res0w
 * @since 2009-9-22
 * @version 0.3
 *
 */
public class SignUpCacheList implements BatchSqlInterface {

    public ArrayList signUpList = new ArrayList();
    public String academy = null;
    public String specialField = null;
    public String classes = null;
    public String sID = null;
    public String sName = null;
    public int sex = 1;
    public String joinItems = null;

    public String[] exeSqls() {
        String[] sqls = new String[1];
        sqls[0] = "insert into signup_cachelist (academy,specialField,classes," +
                "sID,sName,sex,joinItems)values('" + academy + "'," +
                "'" + specialField + "','" + classes + "','" + sID + "'," +
                "'" + sName + "','"+sex+"','"+joinItems+"')";
        return sqls;
    }

    public void readSqls() {
//        throw new UnsupportedOperationException("Not supported yet.");
        //运动员号放在了最前面：
        try {
            DataBaseOperate db=new DataBaseOperate();
            ResultSet rs = null;
            String sql = null;
            sql = "select * from signup_cachelist";
            rs = db.dbQueryMuti(sql);
            while (rs.next()) {
               academy=rs.getString(1);
               specialField=rs.getString(2);
               classes=rs.getString(3);
               sID=rs.getString(4);
               sName=rs.getString(5);
               sex=rs.getInt(6);
               joinItems=rs.getString(7);
            }
             db.dbClosed();
        } catch (SQLException ex) {
            Logger.getLogger(SettingSchedule.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
